public class Main {

    public static void main(String[] args) {
        SeqString s1 = new SeqString(); // 构造空串
        SeqString s2 = new SeqString("hello"); // 以字符串常量构造串对象
        char[] chararray = {'w', 'o', 'r', 'l', 'd'};
        SeqString s3 = new SeqString(chararray); // 以字符数组构造串对象
        System.out.print("s1=");
        s1.toString();
        System.out.print("s2=");
        s2.toString();
        System.out.print("s3=");
        s3.toString();
        System.out.print("串s1从第1个字符开始插入s2后,s1=");
        s1.insert(1, s2);
        System.out.print("串s1删除第1个开始到第3个之前的字符,s1=");
        s1.delete(1, 3);
        System.out.print("截取s3的第2到第3个字符为:");
        String substring = s3.subString(1, 3);
        System.out.println(substring);

    }
}
